<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">"
    <title>Document</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: palevioletred;
        }
    </style>
</head>
<body>
    <div>

    </div>
    <script>
        //获取元素
        let div = document.querySelector('div')
        div.onclick = function (){
        //div.style里面的属性驼峰命名
        this.style.backgroundColor = 'purple' 
        this.style.width = '350px'
        }
    </script>
</body>
</html>